<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs for page system.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="file-name">/_inc/function/system.php</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-functions">Functions</a>
			</div>
	<div class="info-box-body">	
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">System Functions, Furasta.Org</p>
<p class="description"><p>Contains system functions which can be expected  available at all times during execution, frontend  and admin area, ie system wide.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Conor Mac Aoidh &lt;<a href="mailto:conormacaoidh@gmail.com">conormacaoidh@gmail.com</a>&gt;</li>
				<li><span class="field">version:</span> 1.0</li>
				<li><span class="field">license:</span> <a href="http://furasta.org/licence.txt">The BSD License</a></li>
			</ul>
		
			</div>
</div>
		

	
	
	
	<a name="sec-functions"></a>	
	<div class="info-box">
		<div class="info-box-title">Functions</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<span class="disabled">Functions</span>
		</div>
		<div class="info-box-body">	
			<a name="functionaddslashes_array" id="functionaddslashes_array"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">addslashes_array</span> (line <span class="line-number">538</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">addslashes_array</p>
<p class="description"><p>performs the addslashes function on an array</p></p>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			addslashes_array
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$value</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$value</span>			</li>
				</ul>
		
	
</div>
<a name="functionemail" id="functionemail"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">email</span> (line <span class="line-number">102</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">email</p>
<p class="description"><p>Syestem email function. Sends html emails formatted  with a Furasta.Org template.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			email
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$to</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$subject</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$message</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$to</span><span class="var-description">: , who the email should be send to</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$subject</span><span class="var-description">: of the email</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$message</span><span class="var-description">: , content of the email</span>			</li>
				</ul>
		
	
</div>
<a name="functionerror" id="functionerror"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">error</span> (line <span class="line-number">50</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">error</p>
<p class="description"><p>Displays errors by creating a new template object  and loading the admin/layout/error.php template.</p></p>
	<ul class="tags">
				<li><span class="field">todo:</span> error language</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			error
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$error</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$title</span> = <span class="var-default">&#039;Error&#039;</span>], [<span class="var-type">bool</span>&nbsp;<span class="var-name">$report</span> = <span class="var-default">true</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$error</span><span class="var-description">: to be displayed</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$title</span><span class="var-description">: of the error, optional</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$report</span><span class="var-description">: to generate a report or not</span>			</li>
				</ul>
		
	
</div>
<a name="functionfurasta_autoload" id="functionfurasta_autoload"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">furasta_autoload</span> (line <span class="line-number">24</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">furasta_autoload</p>
<p class="description"><p>Autoloads classes stored in the _inc/class directory</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			furasta_autoload
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$class_name</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$class_name</span>			</li>
				</ul>
		
	
</div>
<a name="functiongenerate_error_report" id="functiongenerate_error_report"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">generate_error_report</span> (line <span class="line-number">599</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			generate_error_report
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$error_id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$error</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$name</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$error_id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$error</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$name</span>			</li>
				</ul>
		
	
</div>
<a name="functionhtaccess_rewrite" id="functionhtaccess_rewrite"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">htaccess_rewrite</span> (line <span class="line-number">165</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">htaccess_rewrite</p>
<p class="description"><p>Rewrite the htaccess file, with support for  plugin access.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			htaccess_rewrite
		</span>
				()
			</div>

		
	
</div>
<a name="functionmaintenance_message" id="functionmaintenance_message"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">maintenance_message</span> (line <span class="line-number">647</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">maintenance_message</p>
<p class="description"><p>displays the maintenance mode error</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			maintenance_message
		</span>
				()
			</div>

		
	
</div>
<a name="functionmeta_keywords" id="functionmeta_keywords"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">meta_keywords</span> (line <span class="line-number">554</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">meta_keywords</p>
<p class="description"><p>returns a string of imploded keywords for use  in a meta keywords tag</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			meta_keywords
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$string</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$string</span>			</li>
				</ul>
		
	
</div>
<a name="functionremove_dir" id="functionremove_dir"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">remove_dir</span> (line <span class="line-number">341</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">remove_dir</p>
<p class="description"><p>Deletes all files and directories contained in a  dir, then deletes the dir itself.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			remove_dir
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dir</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$dir</span><span class="var-description">: to be deleted</span>			</li>
				</ul>
		
	
</div>
<a name="functionrss_fetch" id="functionrss_fetch"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">rss_fetch</span> (line <span class="line-number">398</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">rss_fetch</p>
<p class="description"><p>Retrieves rss feed of $url provided in an array. Can  choose number of array items to fetch, and to start at  a certain number.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> or bool false</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			rss_fetch
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$url</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$tagname</span> = <span class="var-default">&#039;item&#039;</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$url</span><span class="var-description">: to fetch rss feed from</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tagname</span><span class="var-description">: , optional &quot;item&quot; is the default</span>			</li>
				</ul>
		
	
</div>
<a name="functionscan_dir" id="functionscan_dir"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">scan_dir</span> (line <span class="line-number">369</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">scan_dir</p>
<p class="description"><p>Scans a dir for subdirs. Returns an  array of dirs, files and hidden  directories are excluded.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			scan_dir
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dir</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$dir</span><span class="var-description">: to be scanned</span>			</li>
				</ul>
		
	
</div>
<a name="functionsettings_rewrite" id="functionsettings_rewrite"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">settings_rewrite</span> (line <span class="line-number">250</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">settings_rewrite</p>
<p class="description"><p>Used to change any of the variables written in the  settings.php file, executes htaccess_rewrite also as  it is possible within settings_rewrite that the active  plugins are changed.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			settings_rewrite
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$SETTINGS</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$DB</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$PLUGINS</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$constants</span> = <span class="var-default">array( )</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$SETTINGS</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$DB</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$PLUGINS</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$constants</span><span class="var-description">: optional</span>			</li>
				</ul>
		
	
</div>
<a name="functionsplit_perm" id="functionsplit_perm"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">split_perm</span> (line <span class="line-number">677</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">split_perm</p>
<p class="description"><p>this function splits permission strings in the  form: 1,2,3#4|1,2,3#4,5 to an array of form:</p><p>array( <ol><li>=&gt; array(</li></ol>		'users' =&gt; array( 1, 2, 3 ), 		'groups' =&gt; array( 4 ) 	), <ol><li>=&gt; array(</li></ol>		'users' =&gt; array( 1, 2, 3 ), 		'groups' =&gt; array( 4, 5 ) 	),  )</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			split_perm
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$perms</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$perms</span>			</li>
				</ul>
		
	
</div>
<a name="functionstripslashes_array" id="functionstripslashes_array"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">stripslashes_array</span> (line <span class="line-number">524</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">stripslashes_array</p>
<p class="description"><p>permforms the stripslashes function on an array</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			stripslashes_array
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$value</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$value</span>			</li>
				</ul>
		
	
</div>
<a name="functionvalidate" id="functionvalidate"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">validate</span> (line <span class="line-number">484</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">validate</p>
<p class="description"><p>Used to validate forms both with javascript and PHP.  Uses the Validate class for php validation and the  jQuery Form Validation Plugin for javascript validation.</p><p>The function returns true if validation has succeeded or  the form wasn't submitted. Returns false if there has  been an error.</p><p>The $conds parameter is an array of inputs to be validated,  and certain conditions which must be met for validation on  that input to succeed. For documentation of all these  parameters see the jQuery Form Validation Plugin located at  _inc/js/jquery/validate.js</p><p>See below for an example usage of the function:</p><p>$conds = array(  	'input-name' =&gt; array(  		'name'		=&gt; 'Text Input', 		'required'	=&gt; true, 		'minlength'	=&gt; 2 	)  );</p><p>The above adds one input named &quot;Name&quot; for validation. The  input is required (must be non-empty) and must have a minimum  length of 2 characters. The name is used for alerts or warnings  when validation fails.</p><p>$valid = validate( $conds, &quot;#form-id&quot;, 'submit-name' );</p><p>The above adds form validation to the form with an id &quot;form-id&quot;  (prefixed with a hash, it's essentially a CSS selector), with  a submit input of the name &quot;submit-name&quot; and with the above  conditions.</p><p>The form validation can then be checked using the following:</p><p>if( $valid ){  	// form validation successful  }</p><p>The validation plugin uses the Template class for displaying  errors. To display errors with the template class simply  create an instance and call the display errors method:</p><p>else{ 	$Template::getInstance( );  	$Template-&gt;displayErrors( );  }</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			validate
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$conds</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$selector</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$post</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$conds</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$selector</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$post</span>			</li>
				</ul>
		
	
</div>
<a name="functionvalidate_file" id="functionvalidate_file"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">validate_file</span> (line <span class="line-number">628</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">validate_file</p>
<p class="description"><p>checks if file exists and also if file  name is safe</p></p>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			validate_file
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$file</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$file</span>			</li>
				</ul>
		
	
</div>
		</div>
	</div>
	
	<p class="notes" id="credit">
		Documentation generated on Thu, 07 Jun 2012 18:22:50 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.4</a>
	</p>
	</div></body>
</html>